package com.benmei.waijiaojun.presenter;


import com.benmei.api.ApiManager;
import com.benmei.bean.HomePage;
import com.benmei.waijiaojun.base.CallBackPresenter;
import com.benmei.waijiaojun.view.HomeView;

import java.util.List;

import rx.Observable;

/**
 * 作者：husunxing
 * 创建日期：2017/11/28.
 * 邮箱：husunxing@outlook.com
 * 描述：
 */
public class HomePresenter extends CallBackPresenter<HomeView,HomePage> {

    @Override
    protected Observable<HomePage> getData() {
        return ApiManager.getInstance().getHomeData();
    }

    @Override
    protected void setResult(HomePage data) {
        mView.HomePageData(data);
        List<HomePage.BannerBean> banner = data.getBanner();
        mView.HomePageBanner(banner);
        List<HomePage.TeachersBean> teachersData = data.getTeachers();
        mView.HomePageTeacherData(teachersData);
    }
}
